<%@ page import="none.rg.gantt.model.Task" %>
<%@ page import="none.rg.gantt.model.Chart" %>

<%
Chart chart = (Chart) request.getAttribute("chart");
int scale = (Integer) request.getAttribute("scale");
%>

<div class="taskline">
<span class="taskname" style="font-style:italic;text-align:right;padding-right:5;color:grey;">Days:</span><%
for (int i = 0; i < chart.getFinishTime(); i++) {
%><span style="width:<%=scale - 1%>;height=100%;border-left:1px solid black;display:inline-block;"><%=i%></span><%
} // for
%></div>

<%
for (Task task : chart.getTasksSorted()) {
%>

<div class="taskline">
<span class="taskname"><%=task.getTitle()%></span>
<span class="filled"style="left:<%=task.getStart() * scale%>px;width:<%=(task.getFinish() - task.getStart()) * scale%>px">
    <%
    if (task.isOfSpecialType("group")) {
    %>
    <img class="backfill" src="../res/group.png"/>
    <%
    } else if (task.isOfSpecialType("milestone")) {
    %>
    <img class="backfill" style="width:<%=scale / 2%>px;" src="../res/milestone.png"/>
    <%
    } else {
    %>
    <img class="backfill" src="../res/<%=task.getCritical().toString().toLowerCase()%>.png"/>
    <%
    } // else
    %>
</span>
</div>

<%
} // for
%>
